# Maintainer: Jaroslav Lichtblau <svetlemodry@archlinux.org>

pkgname=fillets-ng
pkgver=1.0.1
pkgrel=11
pkgdesc="Port of the wonderful puzzle game Fish Fillets"
url="http://fillets.sf.net/"
arch=('loong64' 'x86_64')
license=('GPL')
depends=('fillets-ng-data' 'lua51' 'fribidi' 'gcc-libs' 'libx11' 'sdl_mixer' 'sdl_ttf' 'sdl_image' 'desktop-file-utils')
makedepends=('gendesk')
changelog=$pkgname.changelog
source=(https://downloads.sourceforge.net/fillets/$pkgname-$pkgver.tar.gz
        $pkgname.png lua-config)
sha256sums=('329a4d9515d60bebdb657d070824933b993b85864b9d3e302e6361accab992da'
            '338c9e1b8ac4ef5bb167f4a6090c341897bd2c7f8b4e5afc3ac3131a57bb8c88'
            '65200fa109a819f55843b864164812f6a8e5b5bf910e12732dbc507f8982f29a')
_exec=('fillets')

build() {
  gendesk -n --exec="fillets" --pkgname="fillets-ng" --pkgdesc="Port of the wonderful puzzle game Fish Fillets"
  export PATH=$PATH:$PWD
  cd "${srcdir}"/$pkgname-$pkgver

  ./configure --prefix=/usr --datadir=/usr/share/$pkgname
  make
}

package() {
  cd "${srcdir}"/$pkgname-$pkgver

  make DESTDIR="${pkgdir}" install

  # desktop and icon files
  install -Dm644 "${srcdir}"/$pkgname.png "${pkgdir}"/usr/share/pixmaps/$pkgname.png
  install -Dm644 "${srcdir}"/$pkgname.desktop "${pkgdir}"/usr/share/applications/$pkgname.desktop
}
